<extend name='layout:index'/>
<block name='content'>
		<div class="mws-panel grid_8">
                	<div class="mws-panel-header">
                    	<span> &nbsp;&nbsp;&nbsp;管 理 员 添 加</span>
                    </div>
                    <div class="mws-panel-body no-padding">
                    	<form class="mws-form" action="__MODULE__/role/insert" method='post' onSubmit='return checkForm(this)'>
                    		<div class="mws-form-inline">
                    			<div class="mws-form-row">
                    				<label class="mws-form-label">管理员姓名:</label>
                    				<div class="mws-form-item">
                    					<input type="text" class="small" style='width:200px' name='user_name' id='admin_name'>
                    				</div>
                    			</div>
                    			<div class="mws-form-row">
                    				<label class="mws-form-label">Email地址:</label>
                    				<div class="mws-form-item">
                    					<input type="email" class="small" name='email' id='Email'>
                    				</div>
                    			</div>
                    			<div class="mws-form-row">
                    				<label class="mws-form-label">管理员备注:</label>
                    				<div class="mws-form-item">
                    					<input type="text" class="large" name='note' id='desc'>
                    				</div>
                    			</div>
                    			<div class="mws-form-row">
                    				<label class="mws-form-label">密码:</label>
                    				<div class="mws-form-item">
                    					<input type="password" class="small"  style='width:200px' name='password' id='password'>
                    				</div>
                    			</div>
                    			<div class="mws-form-row">
                    				<label class="mws-form-label">确认密码:</label>
                    				<div class="mws-form-item">
                    					<input type="password" class="small"  style='width:200px' name='repassword' id='repassword'>
                    				</div>
                    			</div>
                    			
                    			<div class="mws-form-row">
                    				<label class="mws-form-label">角色选择:</label>
                    				<div class="mws-form-item">
                    					<select class="small"  style='width:200px' name='role'>
                                            <foreach name='data' item='vo'>
                                            <if condition='$vo.role neq "监视"'>
                    						  <option value='{$vo['role']}'>{$vo['role']}</option>
                                            </if>
                    						</foreach>            						
                    					</select>
                    				</div>
                    			</div>
                    			
                    			
                    		</div>
                    		<div class="mws-button-row">
                    			<input type="submit" value="添加" class="btn btn-danger">
                    			<input type="reset" value="重置" class="btn ">
                    		</div>
                    	</form>
                    </div>    	
                </div>

      <script>
      	function checkForm(){  

      		if($('#admin_name').val()==''){
	      		 var txt=  "未 填 写 管 理 员 名 称";
	                        window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
	   			return false;
	     	 }
	     	 if($('#Email').val()==''){
	      		 var txt=  "未 填 写 邮 箱 地 址";
	                        window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
	   			return false;
	      	}
	      	if($('#password').val()==''||$('#repassword').val()==''){
	      		 var txt=  "未 填 写 密 码";
	                        window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
	   			return false;
	      	}
      		if($('#password').val()!=$('#repassword').val()){
	      		 var txt=  "两 次 密 码 不 同";
	                        window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
	   			return false;
	      	}
	      		return true;
	      
      	}
	     
      </script>

</block>